text = "hello world hello python"
words = text.split()
word_count = {}

for word in words:
    word_count[word] = word_count.get(word, 0) + 1

print(word_count)  # 输出：{'hello': 2, 'world': 1, 'python': 1}